package com.acwing.partition44;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/3/20 19:28
 */
public class AC4378选取数对 {

    private static final int N = 5010, INF = 0x3f3f3f3f;
    private static long[] sum = new long[N];
    //f[i][j]表示所有最后一个区间的右端点为i，且一共选择了j个区间的所有的合法方案集合的最大值
    private static long[][] f = new long[N][N];
    private static int n, m, k;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        m = Integer.parseInt(ss[1]);
        k = Integer.parseInt(ss[2]);
        ss = reader.readLine().split(" ");
        for (int i = 1; i <= n; i++) {
            int x = Integer.parseInt(ss[i - 1]);
            sum[i] += sum[i - 1] + x;
        }
        for (int i = 0; i < N; i++) Arrays.fill(f[i], -INF);
        for (int i = 0; i <= n; i++) f[i][0] = 0;
        for (int j = 1; j <= k; j++) {
            long maxf = 0;
            for (int i = j * m; i <= n; i++) {
                maxf = Math.max(maxf, f[i - m][j - 1] + sum[i] - sum[i - m]);
                f[i][j] = maxf;
            }
        }
        long ans = 0;
        for (int i = 1; i <= n; i++) ans = Math.max(ans, f[i][k]);
        writer.write(ans + "\n");
        writer.flush();
    }
}
